package com.csmd.common.launch;

import com.csmd.common.constant.LauncherConstant;
import org.springblade.core.launch.service.LauncherService;
import org.springframework.boot.builder.SpringApplicationBuilder;

import java.util.Properties;

/**
 * 启动参数拓展
 *
 * @ClassName LauncherServiceImpl
 * @Description 498982703@qq.com
 * @Author gary
 * @Date 2020/11/10 21:13
 * @Version 1.0
 */
public class LauncherServiceImpl implements LauncherService {
    @Override
    public void launcher(SpringApplicationBuilder builder, String appName, String profile) {
        Properties properties = System.getProperties();
        properties.setProperty("spring.clound.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile));
        properties.setProperty("spring.clound.nacos.config.server-addr", LauncherConstant.nacosAddr(profile));
        properties.setProperty("spring.clound.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));
        properties.setProperty("spring.zipkin.base-url", LauncherConstant.zipkinAddr(profile));
    }
}
